﻿using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
using System;
using System.Collections.Generic;

namespace ABCNet.Migrations
{
    public partial class addt1 : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "N_NetPointFinancialLists",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    BusinessId = table.Column<int>(nullable: true),
                    ChangedAmount = table.Column<decimal>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    NetPointId = table.Column<int>(nullable: false),
                    PBusinessType = table.Column<int>(nullable: false),
                    Remark = table.Column<string>(maxLength: 256, nullable: true),
                    UBusinessTypeName = table.Column<string>(maxLength: 256, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_N_NetPointFinancialLists", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "N_NetPoints",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    LastModificationTime = table.Column<DateTime>(nullable: true),
                    LastModifierUserId = table.Column<long>(nullable: true),
                    LockedBalance = table.Column<decimal>(nullable: false),
                    NetType = table.Column<int>(nullable: false),
                    PL1 = table.Column<int>(nullable: false),
                    PL2 = table.Column<int>(nullable: false),
                    PL3 = table.Column<int>(nullable: false),
                    PL4 = table.Column<int>(nullable: false),
                    PL5 = table.Column<int>(nullable: false),
                    PointType = table.Column<int>(nullable: false),
                    RPath = table.Column<string>(maxLength: 1024, nullable: true),
                    RootId = table.Column<int>(nullable: false),
                    UserId = table.Column<long>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_N_NetPoints", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "N_UserFinancialLists",
                columns: table => new
                {
                    Id = table.Column<int>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    BusinessId = table.Column<int>(nullable: true),
                    ChangedAmount = table.Column<decimal>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false),
                    CreatorUserId = table.Column<long>(nullable: true),
                    Remark = table.Column<string>(maxLength: 256, nullable: true),
                    UBusinessType = table.Column<int>(nullable: false),
                    UBusinessTypeName = table.Column<string>(maxLength: 256, nullable: true),
                    UserId = table.Column<long>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_N_UserFinancialLists", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "N_NetPointFinancialLists");

            migrationBuilder.DropTable(
                name: "N_NetPoints");

            migrationBuilder.DropTable(
                name: "N_UserFinancialLists");
        }
    }
}
